package game

import (
	"base"
	. "center_server/logic/internal"
	"leaf/gate"
	"proto/server/game"
)

type gameService struct {
}

func init() {
	service := new(gameService)
	Protocol.Register(new(proto_server_game.OnLogin), service.onLogin)
}

func (*gameService) onLogin(args []interface{}) {
	msg := args[0].(*proto_server_game.OnLogin)
	base.Logger.Release("game service on login, %s", msg)

	agent := args[1].(gate.Agent)
	server := agent.UserData().(*gameServer)

	system.onLogin(server, msg)
}
